package com.kaiwukj.android.ufamily.mvp.ui.page.mine


import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.kaiwukj.android.ufamily.R
import com.kaiwukj.android.ufamily.app.base.review.BaseActivity
import com.kaiwukj.android.ufamily.app.constant.ExtraCons
import com.kaiwukj.android.ufamily.app.constant.MineInfoUrl
import com.kaiwukj.android.ufamily.mvp.http.entity.resultbak.MineUserInfoResult
import com.kaiwukj.android.ufamily.mvp.ui.page.mine.settings.SettingFragment
import kotlinx.android.synthetic.main.activity_edit_mine_info.*
import me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator
import me.yokeyword.fragmentation.anim.FragmentAnimator


/**
 * Copyright © KaiWu Technology Company
 * @author Haife
 * @job Android Development
 * @company KW | 开物科技
 * @time 2019/7/17
 * @desc
 */
@Route(path = MineInfoUrl)
class EditMineInfoActivity : BaseActivity() {


    @Autowired(name = ExtraCons.EXTRA_KEY_EDIT_MINE)
    @JvmField
    var mTargetStr: String? = null

    @Autowired(name = ExtraCons.EXTRA_KEY_MINE_USER_INFO)
    @JvmField
    var mUserInfo: MineUserInfoResult? = null


    override fun getLayoutId(): Int {
        ARouter.getInstance().inject(this)
        return R.layout.activity_edit_mine_info
    }

    override fun initView(savedInstanceState: Bundle?) {
    }


    override fun initData(savedInstanceState: Bundle?) {
        when (mTargetStr) {
            SettingFragment.SETTING_FRAGMENT -> {
                qtb_edit_mine_info.addLeftBackImageButton().setOnClickListener { onBackPressedSupport() }
                qtb_edit_mine_info.setTitle(getString(R.string.setting_title))
                loadRootFragment(R.id.fl_edit_mine_info_container, SettingFragment.newInstance())
            }
        }
    }

    override fun onCreateFragmentAnimator(): FragmentAnimator {
        return DefaultHorizontalAnimator()
    }
}
